<?php
	$p = ""; //PAGE
	
	$t_home = "";
	$t_news = "";
	$t_sport = "";
	$t_celebtv = "";
	$t_advice = "";
	$t_weather = "";
	
	if(isset($_GET["p"]))
	{
		$p = $_GET["p"];
		
		switch($p)
		{
			case "home":
				$t_home = "current_page_item";
			break;
			case "news":
				$t_news = "current_page_item";
			break;
			case "sport":
				$t_sport = "current_page_item";
			break;
			case "celebtv":
				$t_celebtv = "current_page_item";
			break;
			case "advice":
				$t_advice = "current_page_item";
			break;
			case "weather":
				$t_weather = "current_page_item";
			break;
		}
	}
	else
	{
		if(($_SERVER["SCRIPT_NAME"] == "/index.php"))
		{
			$p = "home";
			$t_home = "current_page_item";
		}
	}	
?>
<div id="header">
	<div id="menu"><div id="logo" title="Home"></div>
		<ul class="menuItems">
			<li class="<?php echo $t_home; ?> menuLI"><a class="menuLink" href="/">Home</a></li>
			<li class="<?php echo $t_news; ?> menuLI"><a class="menuLink" href="/?p=news">News</a></li>
			<li class="<?php echo $t_sport; ?> menuLI"><a class="menuLink" href="/?p=sport">Sport</a></li>
			<li class="<?php echo $t_celebtv; ?> menuLI"><a class="menuLink" href="/?p=celebtv">Celebs & TV</a></li>
			<li class="<?php echo $t_advice; ?> menuLI"><a class="menuLink" href="/?p=advice">Advice</a></li>
			<li class="<?php echo $t_weather; ?> menuLI"><a class="menuLink" href="/?p=weather">Weather</a></li>
		</ul>
		
		<?php if(LoggedIn()){ ?><div id="notifications" title='Notifications'></div><? } ?>
		
		<div id="headerOptionBar">
		<?php if(!(LoggedIn())) //not logged in
		{
		?>
			<div id="loginRegister">
			<a href="/rl.php?p=login">Login</a> | <a href="/rl.php?p=register">Register</a>
			</div>
		<?php
		}
		else //logged in
		{
		?>
			<ul id="accountOptions">
				<li id="btnMyAccount"><a class="topButton" id="topButton">My Account</a></li>
				<ul id="dropDown">
					<li id="dd_1" class="accountOption"><a href="<?php echo ToProfile($userID); ?>">Profile</a></li>
					<li id="dd_2" class="accountOption"><a href="/settings.php">Account Settings</a></li>
					<li id="dd_3" class="accountOption"><a href="<?php echo ToProfile($userID); ?>#following">Following</a></li>
					<li id="dd_4" class="accountOption"><a href="/s.php?p=help">Help</a></li>
					<li id="dd_5" class="accountOption"><a href="/logout.php">Sign Out</a></li>
				</ul>
			</ul>
			
				
		<?php
		}
		?>
	</div>
	</div>
	
</div>

<?php if(LoggedIn()) { ?>
	<input type="hidden" id="h_userID" value="<?php echo $userID; ?>"/>
	<input type="hidden" id="h_profilePic" value="noProfilePic.png"/>
<?php } ?>